//
//  main.m
//  oc_12
//
//  Created by 楼楚 on 15/9/14.
//  Copyright (c) 2015年 Chu Lou. All rights reserved.
//

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSMutableArray *arr =[[NSMutableArray alloc]initWithObjects:@"one",@"two",@"three", nil];
        
        NSMutableArray *arr1 = [[NSMutableArray alloc]init];// 空的可变数组
        [arr1 addObject:@"one"];
        [arr1 addObject:@"two"];
        [arr1 addObject:@"three"];
//        NSLog(@"%@",arr);
//        NSLog(@"%@",arr1);

//        [arr removeObject:@"one"];
//        [arr1 removeObject:@"two"];
//        NSLog(@"%@",arr);
//        NSLog(@"%@",arr1);
        
//        [arr removeAllObjects];
//        NSLog(@"%@",arr);
//        [arr removeLastObject];
//        NSLog(@"%@",arr);
        NSLog(@"%@",arr1);
        [arr1 exchangeObjectAtIndex:0 withObjectAtIndex:2];
        NSLog(@"%@",arr1);

        NSString *str = @"this is your bag";
        NSArray *arr3 = [str componentsSeparatedByString:@" "];
        NSLog(@"%@",arr3);
        
        NSMutableArray *arr4= [[NSMutableArray alloc]init];
        NSEnumerator *enumerrator =[arr3 reverseObjectEnumerator];
        id obj = nil;
        while (obj = [enumerrator nextObject]) {
            [arr4 addObject:obj];
        }
        NSLog(@"%@",arr4);

        

        
        
        
        
    }
    return 0;
}
